import {ANALYSIS_VISUALIZE_MODULE, MOCK} from "./_prefix";
import {axios} from '../utils/request'

/**
 *  添加配置信息 POST
 * @param {*} payload
 * @returns
 */
export const visualize = async payload => {
    const { userId, configId, func} = payload;
    return await axios.post(`${ANALYSIS_VISUALIZE_MODULE}/${configId}?userId=${userId}&func=${func}`).then(res => {
        return res;
    });
}

/**
 * 获取一个配置下的所有分析结果 GET
 * @param userId
 * @returns
 */
export const getAnalysisByConfig = async payload => {
    const{ userId, configId} = payload
    const res = await axios.get(`${ANALYSIS_VISUALIZE_MODULE}/${configId}?userId=${userId}`)
    // const res = await axios.get(`${MOCK}/analysis/visualize/{configId}`)
    return res
}